package com.cloudkinto.service.role;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.RoleDo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.service.role.vo.menu.MenuLoginTreeRes;
import com.cloudkinto.service.role.vo.role.RoleAddReq;
import com.cloudkinto.service.role.vo.role.RoleGiveMenuReq;
import com.cloudkinto.service.role.vo.role.RoleUpdateReq;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  service接口
 * </p>
 * @author 张永远
 * @since 2020-05-29
 */
public interface RoleService extends IService<RoleDo> {


    RoleAddReq add(RoleAddReq req, Long userId, Long companyId);

    void giveMenu(RoleGiveMenuReq req,Long userId);

    SingleResult giveMenuInit(Long id);

    SingleResult updateInit(Long id);

    RoleUpdateReq update(RoleUpdateReq updateVo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    PageResult getListPage(Map<String, String> map);

    //根据用户id获取权限
    List<MenuLoginTreeRes> getMenuTree(Long roleId, Integer language, Long companyId);
}
